// !! 此处和后端定义的接口保持一致
export enum API_EVENT {
  RE_NUMBER = "api.mesh.renumber.execute",
  CHECKOUT_STATUS = "api.checkout.status",
  FILE_LOAD = "api.file.load",
  FILE_SAVE = "api.file.save",
  FREE_EDGE_CHECK = "api.mesh.free_edge_check",
  MODEL_ADD = "api.model.add",
  MODEL_INFO = "api.model.info",
  MODEL_SAVE = "api.model.save",
  // * 网格单元操作
  MESH_CREATE = "api.mesh.create",
  MESH_OFFSET = "api.mesh.offset",
  WRAPPER_MESH_CREATE = "api.wrapper.mesh.create",
  MESH_REMESH = "api.mesh.remesh",
  CFD_MESH_CREATE = "api.cfd.mesh.create",
  MESH_ORGANIZED = "api.mesh.organized",
  MERGE_MESH = "api.mesh.merge",
  MESH_DETACH = "api.mesh.detach",
  MESH_CHECK = "api.mesh.check",
  MESH_HIDE_ALL = "api.mesh.hide_all",
  MESH_SWEEP_3D = "api.mesh.sweep3d",
  VIEW_MODE_CHANGE = "api.view.mode_change",
  STATUS_CHANGE = "api.status.change",
  MEASURE_POINT_TO_POINT = "api.measure.point_to_point",
  MASK = "api.mask.mask",
  UNMASK_ALL = "api.mask.unmaskAll",
  REVERSE_ALL = "api.mask.reverseAll",
  REVERSE = "api.mask.reverse",
  DELETE_MESH = "api.mesh.delete",
  DELETE_ENTITY = "api.entity.delete",
  ADD_ENTITY = "api.entity.add",
  MATERIALS_ALL = "api.material.all",
  MATERIAL_CREATE = "api.material.create",
  MATERIAL_RENAME = "api.material.rename",
  CREATE_LOAD_CONSTRAINTS = "api.loads.create",
  CREATE_BCS = "api.bcs.create",
  CREATE_DISPLANCEMENT = "api.bcs.displacement.create",
  CREATE_TEMPERATURE_SET = "api.temperature.create",
  DELETE_TEMPERATURE_SET = "api.temperature.delete",
  TEMPERATURE_MODIFY = "api.temperature.modify",
  TEMPERATURE_SET = "api.temperature.set",
  DELETE_FORCE_SET = "api.loads.delete",
  DELETE_DISPLACEMENT_SET = "api.loads.delete",
  CREATE_FORCE = "api.loads.force.create",
  MODIFY_DISPLACEMENT = "api.bcs.displacement.modify",
  GET_LOAD_CONSTRAINTS = "api.loads.info",
  GET_FORCE_INFO = "api.loads.force.info",
  GET_DISPLACEMENT_INFO = "api.bcs.displacement.info",
  DELETE_ITEM_FORCE = "api.loads.force.delete",
  DELETE_ITEM_DISPLACEMENT = "api.bcs.displacement.delete",
  GET_LOAD_CONSTRAINTS_ALL = "api.loads.all",
  MODIFY_FORCE = "api.loads.force.modify",
  MATERIAL_DELETE = "api.material.delete",
  MATERIAL_ONE = "api.material.one",
  MATERIAL_MODIFY = "api.material.modify",
  PROPERTIES_ALL = "api.property.all",
  PROPERTY_CREATE = "api.property.create",
  PROPERTY_DELETE = "api.property.delete",
  PROPERTY_ONE = "api.property.one",
  PROPERTY_MODIFY = "api.property.modify",
  PROPERTY_ASSIGN = "api.property.assign_comps",
  PROPERTY_RENAME = "api.property.rename",
  SETS_ALL = "api.set.all",
  SET_CREATE = "api.set.create",
  SET_DELETE = "api.set.delete",
  SET_ONE = "api.set.one",
  SET_MODIFY = "api.set.modify",
  SET_ADD = "api.set.add",
  OUTPUTBLOCKS_ALL = "api.outputblock.all",
  OUTPUTBLOCK_CREATE = "api.outputblock.create",
  OUTPUTBLOCK_DELETE = "api.outputblock.delete",
  OUTPUTBLOCK_ONE = "api.outputblock.one",
  OUTPUTBLOCK_MODIFY = "api.outputblock.modify",
  OUTPUTBLOCK_ASSIGN = "api.outputblock.assign_comps",
  MATERIALORIENTATION_CREATE = "api.materialOrientation.create",
  MATERIALORIENTATION_DELETE = "api.materialOrientation.delete",
  MATERIALORIENTATION_MODIFY = "api.materialOrientation.modify",
  CHECK_DUPLICATE_ELEM = "api.duplicate_elem.check", // * 检查重复二维单元
  DELETE_DUPLICATE_ELEM = "api.duplicate_elem.delete", // * 删除重复二维单元
  // * 求解卡片
  GET_ELEMENTS = "api.card.elements",
  CARDS_ALL = "api.card.all",
  CARD_CREATE = "api.card.create",
  CARD_DELETE = "api.card.delete",
  CARD_ONE = "api.card.one",
  CARD_MODIFY = "api.card.modify",
  CARD_ASSIGN = "api.card.assign_comps",
  COORDINATES_ALL = "api.coordinates.all",
  COORDINATE_CREATE = "api.coordinates.create",
  COORDINATE_DELETE = "api.coordinates.delete",
  COORDINATE_ONE = "api.coordinates.one",
  COORDINATE_MODIFY = "api.coordinates.modify",
  COORDINATE_MODIFYNAME = "api.coordinates.modifyname",
  NODECOORDINATE_CREATE = "api.nodeCoordinate.create",
  NODECOORDINATE_DELETE = "api.nodeCoordinate.delete",
  NODECOORDINATE_MODIFY = "api.nodeCoordinate.modify",
  NODECOORDINATE_SET = "api.nodeCoordinate.set",
  COUNTER_BORE = "api.defeature.counter_bore",
  // * 保存工程
  PROJECT_SAVE = "api.project.save",
  // * 加载工程
  PROJECT_LOAD = "api.project.load",
  FACE_FILLET = "api.defeature.face_fillet",
  ANALYSIS_HOLE = "api.defeature.analysis_hole",
  MID_SURFACE = "api.defeature.mid_surface",
  ID_MANAGER = "api.defeature.id_manager",
  Mid_Surface_Thickness = "api.defeature.mid_surface_thickness",
  CREATE_CELL = "api.cell.create",
  TETMESH_CREATE = "api.tetmesh.create",
  MESH_SPLIT = "api.mesh.split",
  FILL_HOLE = "api.fill.hole",
  JOIN_MESHER = "api.join.mesher",
  // * 垫圈网格
  WASHER_CREATE = "api.washer.create",
  WASHER_CLEAR = "api.washer.clear",
  WASHER_HOLE = "api.washer.hole",
  WASHER_FIND = "api.washer.find",
  WASHER_ENTER = "api.washer.enter",
  WASHER_LEAVE = "api.washer.leave",
  WASHER_SELECT = "api.washer.select",
  // * 二维拉伸
  MESHEXTRUDE2D_CLEAR = "api.meshextrude2d.clear",
  MESHEXTRUDE2D_LEAVE = "api.meshextrude2d.leave",
  MESHEXTRUDE2D_UPDATE_METHOD = "api.meshextrude2d.update_method",
  MESHEXTRUDE2D_PREVIEW = "api.meshextrude2d.preview",
  MESHEXTRUDE2D_CREATE = "api.meshextrude2d.create",
  MESHEXTRUDE2D_ADD_ENTITY = "api.meshextrude2d.add_entity",
  // * 三维拉伸
  MESHEXTRUDE3D_CLEAR = "api.meshextrude3d.clear",
  MESHEXTRUDE3D_LEAVE = "api.meshextrude3d.leave",
  MESHEXTRUDE3D_UPDATE_METHOD = "api.meshextrude3d.update_method",
  MESHEXTRUDE3D_CREATE = "api.meshextrude3d.create",
  MESHEXTRUDE3D_ADD_ENTITY = "api.meshextrude3d.add_entity",
  // * 节点缝合
  PASTENODE_ENTER = "api.pastenode.enter",
  PASTENODE_APPLY = "api.pastenode.apply",
  PASTENODE_ADD_NODES = "api.pastenode.add_nodes",
  PASTENODE_CLEAR = "api.pastenode.clear",
  PASTENODE_LEAVE = "api.pastenode.leave",
  Edge_Partition = "api.edge.edge_partition",
  Edge_Mesh_Bias = "api.edge.mesh_bias",
  Edge_Get_Ratio = "api.edge.get_ratio",
  Edge_Leave = "api.edge.leave",
  // * 【几何】切割
  TRIM = "api.trim",
  // find
  FIND_LOAD = "api.find.load",
  // * 法向量
  NORMAL_GET = "api.normal.get",
  NORMAL_REVERSE = "api.normal.reverse", // * 反转法向量
  NORMAL_ALIGN = "api.normal.align", // * 对齐法向量
  //rod
  RODUNIT_CREATE = "api.rod.create",
  //beam
  BEAM_CREATE_BYNODE = "api.beam.create_byNode",
  BEAM_CREATE_BYLINE = "api.beam.create_byLine",
  BEAM_UNDO = "api.beam.undo",
  //场
  FIELD_CREATE = "api.field.create",
  FIELD_DELETE = "api.field.delete",
  FIELD_MODIFY = "api.field.modify",
  FIELD_UPLOAD_FILE = "api.field.upload_file",
  FIELD_ADD_NODES = "api.field.add_nodes",
  // 转换
  TRANSFORM_LEAVE = "api.transform.leave",
  TRANSFORM_UPDATE = "api.transform.update",
  // * 网格质量
  MESH_QUALITY = "api.mesh.quality",
  // Free Body
  FREEBODY_LEAVE = "api.freebody.leave",
  FREEBODY_ENTER = "api.freebody.enter",
  FREEBODY_READ_FILE = "api.freebody.read_file",
  FREEBODY_SETS = "api.freebody.sets",
  FREEBODY_UPDATE_ENTITIES = "api.freebody.update_entities",
  FREEBODY_FIND_NODES = "api.freebody.find_nodes",
  FREEBODY_APPLY = "api.freebody.apply",
  FREEBODY_TABLE_DATA = "api.freebody.table_data",
  SCRIPT_RUN = "api.script.run",
}

export enum TEMPLATE_TYPE {
  NASTRAN = "nastran",
  GEOMETRY = "geometry",
  //新增导入类型
  ABAQUS = "abaqus",
  ANSYS = "ansys",
  LSDYNA = "lsdyna",

  //通用导入类型
  HDF5 = "h5",
  CGNS = "cgns",
}

export enum CARDS_TYPE {
  MATERIAL = "材料",
  PROPERTY = "属性",
  //零件
  PARTS = "零件",
  //装配体
  ASSEMBLIES = "装配体",
}

export interface IReq {
  Topic: string;
  Type: API_EVENT;
  Params: any;
  Req: 1;
  Res: 0;
  Tag: string;
}

export interface IRes {
  Tag: string;
  ReplyTo: string;
  Status: number;
  Result: any;
  Errmsg: string;
  Req: 0;
  Res: 1;
}
